package iD220711010131;
/*

7 2
1,6 2,5 3,4
7 3
1,6:1,1,5 1,2,4 1,3,3
2,5:2,2,3
3,4:

 */
import java.util.Scanner;

public class MainSubSet {
    
    static int count=0;
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while (sc.hasNext()){
            int n=sc.nextInt();
            int k=sc.nextInt();
            Count(1,n,k);
            System.out.println(count);
        }
    }
    
    public static void Count(int a,int n,int k){
        
        if(k==1){
            System.out.println(a + ", " + (n-a) + "!");
            count++;
            return ;
        }
        while (a<=n/k){
            System.out.println(a + ", " +(n-1));
           Count(a,n-a,k-1);
           a++;
        }
    }
}
